package com.itheima_01;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StreamDemo1 {
    public static void main(String[] args) {
        List<String> list1 = List.of("关羽","张飞","刘备","曹操","司马懿");
        List<String> list2 = List.of("赵云", "黄忠", "关平", "关兴");
        ArrayList<String> arrayList1 = new ArrayList<>(list1);
        ArrayList<String> arrayList2 = new ArrayList<>(list2);
        Stream<String> stream = Stream.concat(arrayList1.stream(), arrayList2.stream());
        List<String> r = stream.filter((s) -> s.startsWith("关") && s.length() == 2).collect(Collectors.toList());/*forEach(s-> System.out.println(s));*/
    }
}
